package com.project.bean;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("all")
/**
 * 主贴实体类
 */
public class ThemeBean {
    /** 编号*/
    private int id;
    /** 帖子名称*/
    private String name;
    /** 发布的用户*/
    private UserBean user;
    /** 帖子内容*/
    private String content;
    /** 发布时间*/
    private LocalDate date = LocalDate.now();
    /** 评论的数量*/
    private Integer commentNum;
    /** 评论的集合*/
    private List<CommentBean> list = new ArrayList<>();
    /**所属频道*/
    private ChannelBean channel;

    public ThemeBean() {
    }

    public ThemeBean(String name, int userId, String content, int channelId) {
        this.name = name;
        this.user = new UserBean();
        this.user.setId(userId);
        this.content = content;
        this.channel = new ChannelBean();
        this.channel.setId(channelId);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    public List<CommentBean> getList() {
        return list;
    }

    public void setList(List<CommentBean> list) {
        this.list = list;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    @Override
    public String toString() {
        return "ThemeBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", user=" + user +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", commentNum=" + commentNum +
                ", list=" + list +
                '}';
    }
}
